package life.mahu.community.dto;

import life.mahu.community.exception.CustomizeErrorCode;
import life.mahu.community.exception.CustomizeException;
import lombok.Data;

/**
 * @author 小贱
 * @create 2019-12-31 18:21
 */
@Data
public class PageResultDTO <T> {

    private Integer code;
    private String message;
    private Long count;
    private T data;

    public static <T> PageResultDTO okOf(Integer code, String message, Long count, T t) {
        PageResultDTO pageResultDTO = new PageResultDTO();
        pageResultDTO.setCode(code);
        pageResultDTO.setMessage(message);
        pageResultDTO.setData(t);
        pageResultDTO.setCount(count);
        return pageResultDTO;
    }
}
